# -*- mode: snippet; require-final-newline: nil -*-
# name: prepare
# key: prepare
# binding: direct-keybinding
# --
$sql = "$1";
$prepare = $dbh->prepare ($sql);
$prepare->bindParam(":${2:name}", \$$2);
$prepare->execute ();
if ($prepare->rowCount ()) {
        foreach ($prepare->fetchAll() as $row) {
            \$${3:name} = $row['$3'];
        }
} else {
       $0
}
